{include file="common/header"/}
<div class="lemo-container">
    <div class="lemo-main">
        <div class="admin-main layui-anim layui-anim-upbit">
            <fieldset class="layui-elem-field layui-field-title">
                <legend>申请{:lang('list')}</legend>
                <blockquote class="layui-elem-quote">
                    <div class="lemo-table">
                        <a data-href='{:url("add")}' href="javascript:;" class="layui-btn layui-btn-sm layui-btn-warm add">{:lang('add')}</a>
    
                    </div>
    
                </blockquote>

            </fieldset>

            <table class="layui-table" id="list" lay-filter="list"></table>
        </div>
    </div>
</div>

<script type="text/html" id="action">
    {{# if (d.status === 0) { }}
    <a class="layui-btn  layui-btn-xs" lay-event="examine" data-href="{:url('examine')}?id={{d.id}}">{:lang('examine')}</a>
    <a  class="layui-btn layui-btn-danger layui-btn-xs" lay-event="reject" data-href="{:url('reject')}">{:lang('reject')}</a>
    {{# } else {}}
    <a class="layui-btn  layui-btn-xs layui-btn-disabled" >{:lang('examine')}</a>
    <a  class="layui-btn layui-btn-danger layui-btn-xs layui-btn-disabled">{:lang('reject')}</a>
    {{# }}}
</script>
<script type="text/html" id="status">
    {{# if(d.status ==1) {}}
        已审核
    {{# } else if (d.status ==2) {}}
        驳回
    {{# } else {}}
    未审核
    {{# }}}
</script>

<script type="text/html" id="imgurl">
    <a data-href="{{d.img_url}}" lay-event="look">查看</a>
</script>

{include file="common/footer"/}
<script>
    var tableIn=null;
    layui.config({
        base: "/static/admin/js/",
        version: true
    }).extend({
        Admin: 'Admin'
    }).use(['form', 'table','Admin'], function () {
        var table = layui.table;
        tableIn = table.render({
            elem: '#list',
            url: '{:url("index")}',
            method: 'post',
            cols: [[
                // {checkbox: true, fixed: true},
                {field: 'id', title: 'ID', width: 80,  sort: true},
                {field: 'amount_money', title: '金额', width: 120,sort: true},
                {field: 'description', title: '描述', width: 250,sort: true},
                {field: 'apply_user_id', title: '申请人id', width: 120,sort: true},
                {field: 'reviewer_id', title: '审核人id', width: 120,sort:true},
                {field: 'img_url', title: '截图', width: 120, templet:'#imgurl'},
                {field: 'create_time', title: '创建时间', width: 220,sort:true},
                {field: 'update_time', title: '审核时间', width: 220,sort:true},
                {field: 'status', title: '状态', width: 180, templet:'#status'},
                {title:'操作',width:120, toolbar: '#action',align:"center"}
            ]],
            limits: [10, 15, 20, 25, 50, 100],
            limit: 15,
            page: true
        });

    });


</script>